<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <head th:include="head.html::head">
</head>
<body>
<div id="top" th:include="head.html::top"></div>
<div id="msg" th:text="${msg}"></div>
<form action="/admin/editGoods" method="post">
    <input type="hidden" name="gdid" th:value="${goods.getGdid()}">
    <table>
        <tr><td>名称</td><td><input type="text" th:value="${goods.getGdname}" name="gdname"></td></tr>
        <tr><td>编号</td><td><input type="text" th:value="${goods.getGdcode()}" name="gdcode"></td></tr>
        <tr><td>类别</td>
            <td>
                <select name="tid">
                    <option th:each="goodsType:${goodstypesList}"
                            th:value="${goodsType.getTid()}"
                            th:text="${goodsType.getTname()}"
                            th:selected="${goods.getTid()} eq ${goodsType.getTid()}"
                    >
                    </option>
                </select>
            </td>

        </tr>
        <tr><td>单价</td><td><input type="text" th:value="${goods.getGdprice()}" name="gdprice"></td></tr>
        <tr><td>库存</td><td><input type="text" th:value="${goods.getGdquantity()}" name="gdquantity"></td></tr>
        <tr><td>城市</td><td><input type="text" th:value="${goods.getGdcity()}" name="gdcity"></td></tr>
        <tr><td>商品描述</td><td><textarea th:text="${goods.getGdinfo()}" name="gdinfo"></textarea></td></tr>
        <tr><td>是否热销</td>
            <td>
                <input type="radio" name="gdhot" th:attr="checked = ${goods.getGdhot() == 1}" checked value="1">男
                <input type="radio" name="gdhot" th:attr="checked = ${goods.getGdhot() != 1}" value="0">女
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="reset" value="重置">
                <input type="submit" value="提交">
            </td>
        </tr>

    </table>
</form>
</body>
</html>